Skip to content

feat(api): generate and migrate Function REST resources - #758

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-openapi-functions
Sep 10, 2026
Merged

feat(api): generate and migrate Function REST resources#758
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-openapi-functions

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

AI Summary

Implements the Function metadata slice of #683 by publishing the six CRUD operations tagged Functions and moving load_parameters() retrieval onto the public REST resources. Function request and response models are also exported through the public API.

postFunctionIdInvoke remains on the specialized invocation path because it requires proxy routing, streaming, invocation-specific request shaping, and sync/async behavior outside the generic REST resource contract.

Migration flow

Before
  load_parameters(id=...) ------> raw GET /v1/function/{id}
  load_parameters(slug=...) ----> raw GET /v1/function

After
  load_parameters(id=...) ------> generated GET /v1/function/{id}
  load_parameters(slug=...) ----> generated GET /v1/function

| SDK workflow | Previous wire call | Public REST call | | --- | --- | --- |
| Load by ID | Raw GET /v1/function/{id} | Generated GET /v1/function/{id} | | Load by project and slug | Raw GET /v1/function | Generated GET /v1/function | | Function metadata CRUD | No generated resource | client.openapi.functions |

Behavior Result
Explicit credentials Use isolated, cached generated clients without mutating global login

Refs #683

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-10T16:22:47.157903Z 9e49307 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9094cce1bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread py/src/braintrust/logger.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 895246601b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Comment thread py/scripts/openapi_codegen.py
### AI Summary

Implements the Function metadata slice of #683 by publishing the six CRUD
operations tagged Functions and moving `load_parameters()` retrieval onto the
public REST resources. Function request and response models are also exported
through the public API.

`postFunctionIdInvoke` remains on the specialized invocation path because it
requires proxy routing, streaming, invocation-specific request shaping, and
sync/async behavior outside the generic REST resource contract.

### Migration flow

```text
Before
  load_parameters(id=...) ------> raw GET /v1/function/{id}
  load_parameters(slug=...) ----> raw GET /v1/function

After
  load_parameters(id=...) ------> generated GET /v1/function/{id}
  load_parameters(slug=...) ----> generated GET /v1/function
```

| SDK workflow | Previous wire call | Public REST call |
| --- | --- | --- |
| Load by ID | Raw `GET /v1/function/{id}` | Generated `GET /v1/function/{id}` |
| Load by project and slug | Raw `GET /v1/function` | Generated `GET /v1/function` |
| Function metadata CRUD | No generated resource | `client.openapi.functions` |

| Behavior | Result |
| --- | --- |
| Explicit credentials | Use isolated, cached generated clients without mutating global login |
| Active global login | Reuse the existing generated API client and transport |
| Version and environment | Explicit version continues to take precedence over environment |
| Cache fallback | Preserve local parameter cache fallback for retryable server failures |
| Retry behavior | GET operations are safe reads; writes are not retried |
| Invocation | Continue using the specialized proxy and streaming implementation |
| Type names | Keep the REST model as `Function` and contextually name nested tool-call models |
| Wire keys | Preserve `__schema` without Python name mangling |

Refs #683
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit 3f8ba89 into main Sep 10, 2026
83 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi-openapi-functions branch September 10, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants